<figure class="image">
  <img style="aspect-ratio:1425/654;" src="Bulk Actions_image.png" width="1425"
  height="654">
</figure>
<p>The <em>Bulk Actions</em> dialog makes it easy to apply changes to multiple
  notes at once, ranging from simple actions such as adding or removing a
  label to being executing custom scripts.</p>
<h2>Interaction</h2>
<ul>
  <li>The first step is to select the notes in the&nbsp;<a class="reference-link"
    href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>. It's possible to apply bulk
    actions to:
    <ul>
      <li>A single note (and potentially its child notes) simply by clicking on
        it (with a left click or a right click).</li>
      <li>Multiple notes. See&nbsp;<a class="reference-link" href="#root/_help_yTjUdsOi4CIE">Multiple selection</a>&nbsp;on
        how to do so.</li>
    </ul>
  </li>
  <li>Right click in the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;and
    select <em>Advanced</em> → <em>Apply bulk actions</em>.</li>
  <li>By default, only the selected notes will be affected. To also include
    all the descendants of the notes, check <em>Include descendants of the selected notes</em>.
    The number of affected notes at the top of the dialog will update to reflect
    the change.</li>
  <li>Click on which action to apply from the <em>Available actions</em> section.
    A detailed description of each is available in the next section.
    <ul>
      <li>For each action selected, the <em>Chosen actions</em> section will update
        to reveal the entry. Each action will have its own configuration.</li>
      <li>To remove an action, simply press the X button to the right of it.</li>
      <li>It is possible to apply multiple actions of the same type, such as adding
        multiple types.</li>
    </ul>
  </li>
  <li>When all the actions are defined, press <em>Execute bulk actions</em> to
    trigger all of them at once.</li>
  <li>For convenience, the last bulk action configuration is saved for further
    use and will be restored when entering the dialog again.</li>
</ul>
<h2>Actions</h2>
<h3>Labels</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_HI6GBBIduIgv">Labels</a>&nbsp;of
  a note:</p>
<ul>
  <li><strong>Add label</strong>
    <ul>
      <li>For each note, if it doesn't already have a <a href="#root/_help_HI6GBBIduIgv">label</a> of
        the given name, it will create it. Keep the <em>New value</em> field empty
        to create a label without a value, or complete it to assign a value.</li>
      <li>If a note already has this label, its value will be updated.</li>
    </ul>
  </li>
  <li><strong>Update label value</strong>
    <ul>
      <li>For each note, if it has a <a href="#root/_help_HI6GBBIduIgv">label</a> of
        the given name, it will change its value to the specified one. Leave <em>New value</em> field
        empty to create a label without a value.</li>
      <li>Notes without the label will not be affected.</li>
    </ul>
  </li>
  <li><em><strong>Rename label</strong></em>
    <ul>
      <li>For each note, if it has a <a href="#root/_help_HI6GBBIduIgv">label</a> of
        the given name, it will be renamed/replaced with a label of the new name.
        The value of the label (if present) will be kept intact.</li>
      <li>Notes without the label will not be affected.</li>
    </ul>
  </li>
  <li><strong>Delete label</strong>
    <ul>
      <li>For each note, if it has a label of a given name, it will be deleted (regardless
        of whether it has a value or not).</li>
      <li>Notes without the label will not be affected.</li>
    </ul>
  </li>
</ul>
<h3>Relations</h3>
<p>These actions operate the&nbsp;<a class="reference-link" href="#root/_help_Cq5X6iKQop6R">Relations</a>&nbsp;of
  a note:</p>
<ul>
  <li><strong>Add relation</strong>
    <ul>
      <li>For each note, it will create a relation pointing to the given note.</li>
      <li>Notes without this relation will not be affected.</li>
    </ul>
  </li>
  <li><strong>Update relation target</strong>
    <ul>
      <li>For each note, it will modify a relation to point to the newly given note.</li>
      <li>Notes without this relation will not be affected.</li>
    </ul>
  </li>
  <li><strong>Rename relation</strong>
    <ul>
      <li>For each note, if it has a relation of the given name, it will be renamed/replaced
        with a relation of the new name. The target note of the relation will be
        kept intact.</li>
      <li>Notes without this relation will not be affected.</li>
    </ul>
  </li>
  <li><strong>Delete relation</strong>
    <ul>
      <li>For each note, if it has a relation of the given name, it will be deleted.</li>
      <li>Notes without this relation will not be affected.</li>
    </ul>
  </li>
</ul>
<h3>Notes</h3>
<ul>
  <li><strong>Rename note</strong>
    <ul>
      <li>For each note, it will change the title of the note to the given one.</li>
      <li>As a more advanced use case, the note can be a “template string” which
        allows for dynamic values with access to the note information via&nbsp;
        <a
        class="reference-link" href="#root/_help_habiZ3HU8Kw8">FNote</a>, for example:
          <ul>
            <li><code>NEW: ${note.title}</code> will prefix all notes with <code>NEW:</code> .</li>
            <li><code>${note.dateCreatedObj.format('MM-DD:')}: ${note.title}</code> will
              prefix the note titles with each note's creation date (in month-day format).</li>
          </ul>
      </li>
    </ul>
  </li>
  <li><strong>Move note</strong>
    <ul>
      <li>For each note, it will be moved to the specified parent note.</li>
      <li>As an alternative for less complex situations, the notes can be moved
        directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;via
        cut → paste or via the contextual menu.</li>
    </ul>
  </li>
  <li><strong>Delete note</strong>
    <ul>
      <li>For each note, it will be deleted.</li>
      <li>As an alternative for less complex situations, the notes can be removed
        directly from within the&nbsp;<a class="reference-link" href="#root/_help_oPVyFC7WL2Lp">Note Tree</a>&nbsp;by
        selecting them and pressing <kbd>Delete</kbd>.</li>
    </ul>
  </li>
  <li><strong>Delete note revisions</strong>
    <ul>
      <li>This will delete all the&nbsp;<a class="reference-link" href="#root/_help_vZWERwf8U3nx">Note Revisions</a>&nbsp;of
        the notes.</li>
    </ul>
  </li>
</ul>
<h3>Others</h3>
<ul>
  <li><strong>Execute script</strong>
    <ul>
      <li>For more complex scenarios, it is possible to type in a JavaScript expression
        in order to apply the necessary changes.</li>
      <li>Examples:
        <ul>
          <li>
            <p>To apply a suffix (<code>- suffix</code> in this example), to the note
              title:</p><pre><code class="language-application-javascript-env-backend">note.title = note.title + " - suffix";</code></pre>
          </li>
          <li>
            <p>To alter attributes of a note based on another attribute, such as setting
              the <code>#shareAlias</code> label to the title of the note:</p><pre><code class="language-application-javascript-env-backend">note.setLabel("shareAlias", note.title)</code></pre>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>